//
//  SJAuthStep3View.m
//  SJPay
//
//  Created by 凯朱 on 2024/11/28.
//

#import "SJAuthStep3View.h"

@implementation SJAuthStep3View
-(void)awakeFromNib{
    [super awakeFromNib];
    _titleLbl1.text = kLocalString(@"直系亲属联系人");
    _titleLbl2.text = kLocalString(@"紧急联系人");
    _tf1.placeholder = _tf5.placeholder = kLocalString(@"请选择");
    _tf1.userInteractionEnabled = _tf5.userInteractionEnabled  = NO;
    _tf2.placeholder = _tf6.placeholder = kLocalString(@"请输入姓名");
    _tf3.placeholder = _tf7.placeholder = kLocalString(@"请输入电话");
    _tf4.placeholder = _tf8.placeholder = kLocalString(@"请输入真实姓名");
    _tipLbl1.text = _tipLbl4.text = kLocalString(@"关系：");
    _tipLbl2.text = _tipLbl5.text = kLocalString(@"联系人姓名电话：");
    _tipLbl3.text = _tipLbl6.text = kLocalString(@"真实姓名：");
    [_sureBtn setTitle:kLocalString(@"下一步") forState:UIControlStateNormal];
    [self addTapWith:4 btn:_btn4];
    [self addTapWith:5 btn:_btn5];
    _tf1.userInteractionEnabled = NO;
    _tf5.userInteractionEnabled = NO;
    _bgView2.layer.cornerRadius = 5;
    _bgView2.layer.masksToBounds = YES;
    _bgView3.layer.cornerRadius = 5;
    _bgView3.layer.masksToBounds = YES;
    _bgView3.layer.borderWidth = 1.5;
    _bgView3.layer.borderColor = kHexColor(@"#C0C9EC").CGColor;
    
    _sureBtn.layer.cornerRadius = 25;
    _sureBtn.layer.masksToBounds = YES;
}

-(void)addTapWith:(NSInteger)index btn:(UIView *)btn{
    kWeakSelf(self);
    btn.userInteractionEnabled = YES;
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id  _Nonnull sender) {
        if (weakself.btnBlock) {
            weakself.btnBlock(index);
        }
    }];
    [btn addGestureRecognizer:tap];
}



- (IBAction)btnAction:(id)sender {
    if (sender == _btn1) {
        if (self.btnBlock) self.btnBlock(1);
    }else if (sender == _btn2){
        if (self.btnBlock) self.btnBlock(2);
    }else if (sender == _sureBtn){
        if (self.btnBlock) self.btnBlock(3);
    }
}

@end
